<template>
  <div class="table-test">
    <el-table-column></el-table-column>

    <el-table :data="list" size="mini" show-summary border stripe :summary-method="goodsRatioSum" v-tableMove
                      max-height="500px" key="workPriceColumn" style="width: 100%;">
      <el-table-column label="默认" prop="checked" width="60px" align="center" fixed>
        <el-table-column v-testChild label="生产方式" prop="checked" width="60px" align="center">
          <template slot-scope="scope">
            <span v-if="scope.row['1'] === '原版工价'">原版工价</span>
            <span v-else-if="scope.row['1'] === '异形加钱'">异形加钱</span>
            <el-checkbox v-else v-model="scope.row.checked" disabled></el-checkbox>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="规格" prop="1" min-width="100px" show-overflow-tooltip fixed>
        <el-table-column prop="1" min-width="100px" show-overflow-tooltip>
          <template slot-scope="scope" v-if="scope.row['1'] !== '原版工价' && scope.row['1'] !== '异形加钱'">{{scope.row['1']}}</template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="系数" prop="2" width="60px" fixed>
        <el-table-column prop="2" width="60px">
          <template slot-scope="scope" v-if="scope.row['1'] !== '原版工价' && scope.row['1'] !== '异形加钱'">{{scope.row['2']}}</template>
        </el-table-column>
      </el-table-column>
      <template v-for="(prop, i) of priceInfo.workPriceColumn">
        <template v-if="prop.id !== '1' && prop.id !== '2'">
          <el-table-column v-if="prop.processModes && prop.processModes.length" :label="prop.name" :prop="prop.id" align="center" :key="prop.id">
            <template v-for="(child, j) of prop.processModes">
              <el-table-column :label="child.name" :prop="prop.id + '__' +child.name" width="60px" :key="child.id">
                <template v-if="i % 2 === 0 && j % 2 > 0" slot-scope="scope">
                  <el-input v-if="scope.row['1']==='原版工价'" size="mini" :min="0" :max="999999999" :controls="false" v-model="scope.row[prop.id][0][child.name]"></el-input>
                  <el-input-number v-else size="mini" v-model="scope.row[prop.id][0][child.name]" :min="0" :max="999999999" :controls="false" />
                </template>
              </el-table-column>
            </template>
          </el-table-column>
          <el-table-column v-else :label="prop.name" :prop="prop.id" width="60" :key="prop.id">
            <el-table-column :prop="prop.id" width="60">
              <template v-if="i % 2 > 0" slot-scope="scope">
                <el-input v-if="scope.row['1']==='原版工价'" size="mini" :min="0" :max="999999999" :controls="false" v-model="scope.row[prop.id]"></el-input>
                <el-input-number v-else size="mini" v-model="scope.row[prop.id]" :min="0" :max="999999999" :controls="false" />
              </template>
            </el-table-column>
          </el-table-column>
        </template>
      </template>
      <el-table-column label="小计" prop="total" width="60px" align="center">
        <el-table-column prop="total" width="60px" align="center"></el-table-column>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
    name: 'TableTest',
    directive: {
        testChild: {
             // 在绑定元素的 attribute 前
            // 或事件监听器应用前调用
            created(el, binding, vnode, prevVnode) {
                // 下面会介绍各个参数的细节
                console.log('==========el=================')
                console.log(el)
                console.log('==========binding=================')
                console.log(binding)
                console.log('==========vnode=================')
                console.log(vnode)
                console.log('==========prevVnode=================')
                console.log(prevVnode)
            },
            // 在元素被插入到 DOM 前调用
            beforeMount(el, binding, vnode, prevVnode) {},
            // 在绑定元素的父组件
            // 及他自己的所有子节点都挂载完成后调用
            mounted(el, binding, vnode, prevVnode) {},
            // 绑定元素的父组件更新前调用
            beforeUpdate(el, binding, vnode, prevVnode) {},
            // 在绑定元素的父组件
            // 及他自己的所有子节点都更新后调用
            updated(el, binding, vnode, prevVnode) {},
            // 绑定元素的父组件卸载前调用
            beforeUnmount(el, binding, vnode, prevVnode) {},
            // 绑定元素的父组件卸载后调用
            unmounted(el, binding, vnode, prevVnode) {}
        }
    },
    data() {
      return {
        priceInfo: {
          "workPriceColumn":[
              {
                  "id":"1",
                  "name":"规格",
                  "sort":-2,
                  "processModes":null
              },
              {
                  "id":"2",
                  "name":"系数",
                  "sort":-1,
                  "processModes":null
              },
              {
                  "id":"7e85cc52-67e7-7952-0d4b-39fcd7ac4e84",
                  "name":"工序100",
                  "sort":0,
                  "processModes":[

                  ]
              },
              {
                  "id":"3334bae6-992d-90c1-d979-39fca05e6f06",
                  "name":"工序1",
                  "sort":1,
                  "processModes":[
                      {
                          "id":"95ed3b1d-8cdb-549d-d9bb-39fead201b0b",
                          "name":"方式1"
                      },
                      {
                          "id":"7d71dee3-4dac-7610-f2b3-39fead201b09",
                          "name":"方式2"
                      },
                      {
                          "id":"1273afca-98f1-95ee-fd91-39fead201b0b",
                          "name":"方式3"
                      }
                  ]
              },
              {
                  "id":"03239fa6-3154-0d39-fa8f-39fca05ebafd",
                  "name":"工序2",
                  "sort":2,
                  "processModes":[

                  ]
              },
              {
                  "id":"69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a",
                  "name":"工序3",
                  "sort":3,
                  "processModes":[

                  ]
              },
              {
                  "id":"dfc499d8-94c4-1ef4-e4c5-39fca05f37b2",
                  "name":"工序4",
                  "sort":4,
                  "processModes":[
                      {
                          "id":"59d8da29-12ed-a271-befa-39fedff2c851",
                          "name":"车裁"
                      },
                      {
                          "id":"ac36f942-3a92-dc3b-0a8b-39fedff2c851",
                          "name":"机裁"
                      }
                  ]
              },
              {
                  "id":"a4c5256d-1f24-6fb6-881c-39fca05f740b",
                  "name":"工序5",
                  "sort":5,
                  "processModes":[
                      {
                          "id":"e5a239fa-2600-941a-754c-39fedff2aa0a",
                          "name":"方式1"
                      },
                      {
                          "id":"c79a90ad-3b40-8b27-57d0-39fedff2aa0a",
                          "name":"方式2"
                      }
                  ]
              },
              {
                  "id":"b2f5a7d9-9155-cb84-756b-39fca05fa855",
                  "name":"工序6",
                  "sort":6,
                  "processModes":[
                      {
                          "id":"b41c346a-1277-91d6-3b47-39fedff294a0",
                          "name":"方式1"
                      },
                      {
                          "id":"1ce9a0ac-631a-ec57-5124-39fedff294a0",
                          "name":"方式2"
                      },
                      {
                          "id":"49246b0e-5d5d-b467-0d08-39fedff294a0",
                          "name":"方式3"
                      }
                  ]
              },
              {
                  "id":"bfe95b12-f5b5-65a8-2818-39fca05fe3e0",
                  "name":"工序7",
                  "sort":7,
                  "processModes":[
                      {
                          "id":"4ed6c6e4-67e5-c582-afad-39fe8d93e226",
                          "name":"机裁"
                      },
                      {
                          "id":"7a38c4b7-9704-7b00-4000-39fe8d93e226",
                          "name":"手工"
                      }
                  ]
              },
              {
                  "id":"f12cd190-cc15-69f5-9c30-39fca0602186",
                  "name":"工序8",
                  "sort":8,
                  "processModes":[

                  ]
              },
              {
                  "id":"87434044-adaa-ef81-a4d7-39fca060a01f",
                  "name":"工序10",
                  "sort":10,
                  "processModes":[

                  ]
              },
              {
                  "id":"4288fed4-385b-edcb-e11e-39fca060dc22",
                  "name":"工序11",
                  "sort":11,
                  "processModes":[

                  ]
              },
              {
                  "id":"c700537e-488b-b602-c2b3-39fca06111cc",
                  "name":"工序12",
                  "sort":12,
                  "processModes":[

                  ]
              },
              {
                  "id":"2a1814c0-388d-0bbe-3c2f-39fca06143a5",
                  "name":"工序13",
                  "sort":13,
                  "processModes":[

                  ]
              },
              {
                  "id":"581d876c-e0e5-c903-5b9d-39fca06176a3",
                  "name":"工序14",
                  "sort":14,
                  "processModes":[

                  ]
              },
              {
                  "id":"9510af48-c4a0-7581-3cfe-39fca061ada3",
                  "name":"工序15",
                  "sort":15,
                  "processModes":[

                  ]
              },
              {
                  "id":"481c1c1c-dba5-3b61-96bc-39fca06213d5",
                  "name":"工序16",
                  "sort":16,
                  "processModes":[
                      {
                          "id":"413bbec8-28bd-17d3-d7e4-39fedff1df04",
                          "name":"方式1"
                      },
                      {
                          "id":"e89d1415-2129-e79a-c314-39fedff1df04",
                          "name":"方式2"
                      }
                  ]
              }
          ],
          "dt":[
              {
                  "1":"Ø1300",
                  "2":0.2,
                  "7e85cc52-67e7-7952-0d4b-39fcd7ac4e84":0,
                  "3334bae6-992d-90c1-d979-39fca05e6f06":[
                      {
                          "方式1":0.4,
                          "方式2":0,
                          "方式3":0
                      }
                  ],
                  "03239fa6-3154-0d39-fa8f-39fca05ebafd":0,
                  "69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a":0,
                  "dfc499d8-94c4-1ef4-e4c5-39fca05f37b2":[
                      {
                          "车裁":0,
                          "机裁":0
                      }
                  ],
                  "a4c5256d-1f24-6fb6-881c-39fca05f740b":[
                      {
                          "方式1":0,
                          "方式2":0
                      }
                  ],
                  "b2f5a7d9-9155-cb84-756b-39fca05fa855":[
                      {
                          "方式1":0,
                          "方式2":0,
                          "方式3":0
                      }
                  ],
                  "bfe95b12-f5b5-65a8-2818-39fca05fe3e0":[
                      {
                          "机裁":2,
                          "手工":4
                      }
                  ],
                  "f12cd190-cc15-69f5-9c30-39fca0602186":0,
                  "87434044-adaa-ef81-a4d7-39fca060a01f":0,
                  "4288fed4-385b-edcb-e11e-39fca060dc22":1.2,
                  "c700537e-488b-b602-c2b3-39fca06111cc":0,
                  "2a1814c0-388d-0bbe-3c2f-39fca06143a5":0,
                  "581d876c-e0e5-c903-5b9d-39fca06176a3":0,
                  "9510af48-c4a0-7581-3cfe-39fca061ada3":0,
                  "481c1c1c-dba5-3b61-96bc-39fca06213d5":[
                      {
                          "方式1":0,
                          "方式2":0
                      }
                  ],
                  "checked":false,
                  "total":7.6
              },
              {
                  "1":"1",
                  "2":0.3,
                  "7e85cc52-67e7-7952-0d4b-39fcd7ac4e84":0,
                  "3334bae6-992d-90c1-d979-39fca05e6f06":[
                      {
                          "方式1":0.6,
                          "方式2":0,
                          "方式3":0
                      }
                  ],
                  "03239fa6-3154-0d39-fa8f-39fca05ebafd":0,
                  "69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a":0,
                  "dfc499d8-94c4-1ef4-e4c5-39fca05f37b2":[
                      {
                          "车裁":0,
                          "机裁":0
                      }
                  ],
                  "a4c5256d-1f24-6fb6-881c-39fca05f740b":[
                      {
                          "方式1":0,
                          "方式2":0
                      }
                  ],
                  "b2f5a7d9-9155-cb84-756b-39fca05fa855":[
                      {
                          "方式1":0,
                          "方式2":0,
                          "方式3":0
                      }
                  ],
                  "bfe95b12-f5b5-65a8-2818-39fca05fe3e0":[
                      {
                          "机裁":2,
                          "手工":6
                      }
                  ],
                  "f12cd190-cc15-69f5-9c30-39fca0602186":0,
                  "87434044-adaa-ef81-a4d7-39fca060a01f":0,
                  "4288fed4-385b-edcb-e11e-39fca060dc22":1.8,
                  "c700537e-488b-b602-c2b3-39fca06111cc":0,
                  "2a1814c0-388d-0bbe-3c2f-39fca06143a5":0,
                  "581d876c-e0e5-c903-5b9d-39fca06176a3":0,
                  "9510af48-c4a0-7581-3cfe-39fca061ada3":0,
                  "481c1c1c-dba5-3b61-96bc-39fca06213d5":[
                      {
                          "方式1":0,
                          "方式2":0
                      }
                  ],
                  "checked":true,
                  "total":10.4
              },
              {
                  "1":"3",
                  "2":0.6,
                  "7e85cc52-67e7-7952-0d4b-39fcd7ac4e84":0,
                  "3334bae6-992d-90c1-d979-39fca05e6f06":[
                      {
                          "方式1":1.2,
                          "方式2":0,
                          "方式3":0
                      }
                  ],
                  "03239fa6-3154-0d39-fa8f-39fca05ebafd":0,
                  "69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a":0,
                  "dfc499d8-94c4-1ef4-e4c5-39fca05f37b2":[
                      {
                          "车裁":0,
                          "机裁":0
                      }
                  ],
                  "a4c5256d-1f24-6fb6-881c-39fca05f740b":[
                      {
                          "方式1":0,
                          "方式2":0
                      }
                  ],
                  "b2f5a7d9-9155-cb84-756b-39fca05fa855":[
                      {
                          "方式1":0,
                          "方式2":0,
                          "方式3":0
                      }
                  ],
                  "bfe95b12-f5b5-65a8-2818-39fca05fe3e0":[
                      {
                          "机裁":3,
                          "手工":7
                      }
                  ],
                  "f12cd190-cc15-69f5-9c30-39fca0602186":0,
                  "87434044-adaa-ef81-a4d7-39fca060a01f":0,
                  "4288fed4-385b-edcb-e11e-39fca060dc22":3.6,
                  "c700537e-488b-b602-c2b3-39fca06111cc":0,
                  "2a1814c0-388d-0bbe-3c2f-39fca06143a5":0,
                  "581d876c-e0e5-c903-5b9d-39fca06176a3":0,
                  "9510af48-c4a0-7581-3cfe-39fca061ada3":0,
                  "481c1c1c-dba5-3b61-96bc-39fca06213d5":[
                      {
                          "方式1":0,
                          "方式2":0
                      }
                  ],
                  "checked":true,
                  "total":14.8
              },
              {
                  "1":"原版工价",
                  "2":0,
                  "7e85cc52-67e7-7952-0d4b-39fcd7ac4e84":0,
                  "3334bae6-992d-90c1-d979-39fca05e6f06":[
                      {
                          "方式1":2,
                          "方式2":0,
                          "方式3":0
                      }
                  ],
                  "03239fa6-3154-0d39-fa8f-39fca05ebafd":0,
                  "69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a":0,
                  "dfc499d8-94c4-1ef4-e4c5-39fca05f37b2":[
                      {
                          "车裁":0,
                          "机裁":0
                      }
                  ],
                  "a4c5256d-1f24-6fb6-881c-39fca05f740b":[
                      {
                          "方式1":0,
                          "方式2":0
                      }
                  ],
                  "b2f5a7d9-9155-cb84-756b-39fca05fa855":[
                      {
                          "方式1":0,
                          "方式2":0,
                          "方式3":0
                      }
                  ],
                  "bfe95b12-f5b5-65a8-2818-39fca05fe3e0":[
                      {
                          "机裁":0,
                          "手工":0
                      }
                  ],
                  "f12cd190-cc15-69f5-9c30-39fca0602186":0,
                  "87434044-adaa-ef81-a4d7-39fca060a01f":0,
                  "4288fed4-385b-edcb-e11e-39fca060dc22":6,
                  "c700537e-488b-b602-c2b3-39fca06111cc":0,
                  "2a1814c0-388d-0bbe-3c2f-39fca06143a5":0,
                  "581d876c-e0e5-c903-5b9d-39fca06176a3":0,
                  "9510af48-c4a0-7581-3cfe-39fca061ada3":0,
                  "481c1c1c-dba5-3b61-96bc-39fca06213d5":[
                      {
                          "方式1":0,
                          "方式2":0
                      }
                  ],
                  "checked":false,
                  "total":8
              },
              {
                  "1":"异形加钱",
                  "2":0,
                  "7e85cc52-67e7-7952-0d4b-39fcd7ac4e84":0,
                  "3334bae6-992d-90c1-d979-39fca05e6f06":[
                      {
                          "方式1":1,
                          "方式2":0,
                          "方式3":0
                      }
                  ],
                  "03239fa6-3154-0d39-fa8f-39fca05ebafd":0,
                  "69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a":0,
                  "dfc499d8-94c4-1ef4-e4c5-39fca05f37b2":[
                      {
                          "车裁":0,
                          "机裁":0
                      }
                  ],
                  "a4c5256d-1f24-6fb6-881c-39fca05f740b":[
                      {
                          "方式1":0,
                          "方式2":0
                      }
                  ],
                  "b2f5a7d9-9155-cb84-756b-39fca05fa855":[
                      {
                          "方式1":0,
                          "方式2":0,
                          "方式3":0
                      }
                  ],
                  "bfe95b12-f5b5-65a8-2818-39fca05fe3e0":[
                      {
                          "机裁":0,
                          "手工":0
                      }
                  ],
                  "f12cd190-cc15-69f5-9c30-39fca0602186":0,
                  "87434044-adaa-ef81-a4d7-39fca060a01f":0,
                  "4288fed4-385b-edcb-e11e-39fca060dc22":0,
                  "c700537e-488b-b602-c2b3-39fca06111cc":0,
                  "2a1814c0-388d-0bbe-3c2f-39fca06143a5":0,
                  "581d876c-e0e5-c903-5b9d-39fca06176a3":0,
                  "9510af48-c4a0-7581-3cfe-39fca061ada3":0,
                  "481c1c1c-dba5-3b61-96bc-39fca06213d5":[
                      {
                          "方式1":0,
                          "方式2":0
                      }
                  ],
                  "checked":false,
                  "total":1
              }
          ],
          "priceCommons":[

          ],
          "tableIndex":"ratio"
        },
        list : [
          {
              "1":"Ø1300",
              "2":0.2,
              "7e85cc52-67e7-7952-0d4b-39fcd7ac4e84":0,
              "3334bae6-992d-90c1-d979-39fca05e6f06":[
                  {
                      "方式1":0.4,
                      "方式2":0.4,
                      "方式3":0
                  }
              ],
              "03239fa6-3154-0d39-fa8f-39fca05ebafd":0,
              "69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a":0,
              "dfc499d8-94c4-1ef4-e4c5-39fca05f37b2":[
                  {
                      "车裁":0,
                      "机裁":0
                  }
              ],
              "a4c5256d-1f24-6fb6-881c-39fca05f740b":[
                  {
                      "方式1":0,
                      "方式2":0
                  }
              ],
              "b2f5a7d9-9155-cb84-756b-39fca05fa855":[
                  {
                      "方式1":0,
                      "方式2":0,
                      "方式3":0
                  }
              ],
              "bfe95b12-f5b5-65a8-2818-39fca05fe3e0":[
                  {
                      "机裁":2,
                      "手工":4
                  }
              ],
              "f12cd190-cc15-69f5-9c30-39fca0602186":0,
              "87434044-adaa-ef81-a4d7-39fca060a01f":0,
              "4288fed4-385b-edcb-e11e-39fca060dc22":1.2,
              "c700537e-488b-b602-c2b3-39fca06111cc":0,
              "2a1814c0-388d-0bbe-3c2f-39fca06143a5":0,
              "581d876c-e0e5-c903-5b9d-39fca06176a3":0,
              "9510af48-c4a0-7581-3cfe-39fca061ada3":0,
              "481c1c1c-dba5-3b61-96bc-39fca06213d5":[
                  {
                      "方式1":0,
                      "方式2":0
                  }
              ],
              "checked":false,
              "total":8
          },
          {
              "1":"1",
              "2":0.3,
              "7e85cc52-67e7-7952-0d4b-39fcd7ac4e84":0,
              "3334bae6-992d-90c1-d979-39fca05e6f06":[
                  {
                      "方式1":0.6,
                      "方式2":0.6,
                      "方式3":0
                  }
              ],
              "03239fa6-3154-0d39-fa8f-39fca05ebafd":0,
              "69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a":0,
              "dfc499d8-94c4-1ef4-e4c5-39fca05f37b2":[
                  {
                      "车裁":0,
                      "机裁":0
                  }
              ],
              "a4c5256d-1f24-6fb6-881c-39fca05f740b":[
                  {
                      "方式1":0,
                      "方式2":0
                  }
              ],
              "b2f5a7d9-9155-cb84-756b-39fca05fa855":[
                  {
                      "方式1":0,
                      "方式2":0,
                      "方式3":0
                  }
              ],
              "bfe95b12-f5b5-65a8-2818-39fca05fe3e0":[
                  {
                      "机裁":2,
                      "手工":6
                  }
              ],
              "f12cd190-cc15-69f5-9c30-39fca0602186":0,
              "87434044-adaa-ef81-a4d7-39fca060a01f":0,
              "4288fed4-385b-edcb-e11e-39fca060dc22":1.8,
              "c700537e-488b-b602-c2b3-39fca06111cc":0,
              "2a1814c0-388d-0bbe-3c2f-39fca06143a5":0,
              "581d876c-e0e5-c903-5b9d-39fca06176a3":0,
              "9510af48-c4a0-7581-3cfe-39fca061ada3":0,
              "481c1c1c-dba5-3b61-96bc-39fca06213d5":[
                  {
                      "方式1":0,
                      "方式2":0
                  }
              ],
              "checked":true,
              "total":11
          },
          {
              "1":"3",
              "2":0.6,
              "7e85cc52-67e7-7952-0d4b-39fcd7ac4e84":0,
              "3334bae6-992d-90c1-d979-39fca05e6f06":[
                  {
                      "方式1":1.2,
                      "方式2":1.2,
                      "方式3":0
                  }
              ],
              "03239fa6-3154-0d39-fa8f-39fca05ebafd":0,
              "69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a":0,
              "dfc499d8-94c4-1ef4-e4c5-39fca05f37b2":[
                  {
                      "车裁":0,
                      "机裁":0
                  }
              ],
              "a4c5256d-1f24-6fb6-881c-39fca05f740b":[
                  {
                      "方式1":0,
                      "方式2":0
                  }
              ],
              "b2f5a7d9-9155-cb84-756b-39fca05fa855":[
                  {
                      "方式1":0,
                      "方式2":0,
                      "方式3":0
                  }
              ],
              "bfe95b12-f5b5-65a8-2818-39fca05fe3e0":[
                  {
                      "机裁":3,
                      "手工":7
                  }
              ],
              "f12cd190-cc15-69f5-9c30-39fca0602186":0,
              "87434044-adaa-ef81-a4d7-39fca060a01f":0,
              "4288fed4-385b-edcb-e11e-39fca060dc22":3.6,
              "c700537e-488b-b602-c2b3-39fca06111cc":0,
              "2a1814c0-388d-0bbe-3c2f-39fca06143a5":0,
              "581d876c-e0e5-c903-5b9d-39fca06176a3":0,
              "9510af48-c4a0-7581-3cfe-39fca061ada3":0,
              "481c1c1c-dba5-3b61-96bc-39fca06213d5":[
                  {
                      "方式1":0,
                      "方式2":0
                  }
              ],
              "checked":true,
              "total":16
          },
          {
              "1":"原版工价",
              "2":0,
              "7e85cc52-67e7-7952-0d4b-39fcd7ac4e84":0,
              "3334bae6-992d-90c1-d979-39fca05e6f06":[
                  {
                      "方式1":2,
                      "方式2":2,
                      "方式3":0
                  }
              ],
              "03239fa6-3154-0d39-fa8f-39fca05ebafd":0,
              "69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a":0,
              "dfc499d8-94c4-1ef4-e4c5-39fca05f37b2":[
                  {
                      "车裁":0,
                      "机裁":0
                  }
              ],
              "a4c5256d-1f24-6fb6-881c-39fca05f740b":[
                  {
                      "方式1":0,
                      "方式2":0
                  }
              ],
              "b2f5a7d9-9155-cb84-756b-39fca05fa855":[
                  {
                      "方式1":0,
                      "方式2":0,
                      "方式3":0
                  }
              ],
              "bfe95b12-f5b5-65a8-2818-39fca05fe3e0":[
                  {
                      "机裁":0,
                      "手工":0
                  }
              ],
              "f12cd190-cc15-69f5-9c30-39fca0602186":0,
              "87434044-adaa-ef81-a4d7-39fca060a01f":0,
              "4288fed4-385b-edcb-e11e-39fca060dc22":6,
              "c700537e-488b-b602-c2b3-39fca06111cc":0,
              "2a1814c0-388d-0bbe-3c2f-39fca06143a5":0,
              "581d876c-e0e5-c903-5b9d-39fca06176a3":0,
              "9510af48-c4a0-7581-3cfe-39fca061ada3":0,
              "481c1c1c-dba5-3b61-96bc-39fca06213d5":[
                  {
                      "方式1":0,
                      "方式2":0
                  }
              ],
              "checked":false,
              "total":10
          },
          {
              "1":"异形加钱",
              "2":0,
              "7e85cc52-67e7-7952-0d4b-39fcd7ac4e84":0,
              "3334bae6-992d-90c1-d979-39fca05e6f06":[
                  {
                      "方式1":1,
                      "方式2":0,
                      "方式3":0
                  }
              ],
              "03239fa6-3154-0d39-fa8f-39fca05ebafd":0,
              "69d33fe0-d4eb-5fa4-2d3a-39fca05eed3a":0,
              "dfc499d8-94c4-1ef4-e4c5-39fca05f37b2":[
                  {
                      "车裁":0,
                      "机裁":0
                  }
              ],
              "a4c5256d-1f24-6fb6-881c-39fca05f740b":[
                  {
                      "方式1":0,
                      "方式2":0
                  }
              ],
              "b2f5a7d9-9155-cb84-756b-39fca05fa855":[
                  {
                      "方式1":0,
                      "方式2":0,
                      "方式3":0
                  }
              ],
              "bfe95b12-f5b5-65a8-2818-39fca05fe3e0":[
                  {
                      "机裁":0,
                      "手工":0
                  }
              ],
              "f12cd190-cc15-69f5-9c30-39fca0602186":0,
              "87434044-adaa-ef81-a4d7-39fca060a01f":0,
              "4288fed4-385b-edcb-e11e-39fca060dc22":0,
              "c700537e-488b-b602-c2b3-39fca06111cc":0,
              "2a1814c0-388d-0bbe-3c2f-39fca06143a5":0,
              "581d876c-e0e5-c903-5b9d-39fca06176a3":0,
              "9510af48-c4a0-7581-3cfe-39fca061ada3":0,
              "481c1c1c-dba5-3b61-96bc-39fca06213d5":[
                  {
                      "方式1":0,
                      "方式2":0
                  }
              ],
              "checked":false,
              "total":1
          }
        ]
      }
    },
    methods: {
      goodsRatioSum(param) {
        const {columns, data} = param;
        let sums = [];
        columns.forEach((col, i) => {
          if (i === 0) return sums.push('合计');
          if (col.property === '1' || col.property === 'total') return sums.push('');
          let sum = 0, keys = col.property && col.property !== '2' ? col.property.split('__') : [];
          data.forEach(item => {
            if (item['1'] === '原版工价' || item['1'] === '异形加钱') return item;
            if (col.property === '2') {
              sum += item['2'] || 0;
            }
            if (keys && keys.length === 2) {
              item[keys[0]][0][keys[1]] = item[keys[0]][0][keys[1]] ? Math.round(item[keys[0]][0][keys[1]] * 100) / 100 : 0;
              sum += item[keys[0]][0][keys[1]];
            }
            if (keys && keys.length === 1) {
              item[keys[0]] = item[keys[0]] ? Math.round(item[keys[0]] * 100) / 100 : 0;
              sum += item[keys[0]];
            }
          });
          sums.push(Math.round(sum * 100) / 100);
        });
        return sums;
      },
    }
  }
</script>

<style lang="less" scoped>
  .table-test {
    .el-input {
      width: 100%;
    }
  }
</style>
